<section class="content-header">
  <ol class="breadcrumb">
    <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
    <li><a class="active">寄件列表</a></li>
  </ol>
</section>
<section class="content">
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">查询条件</h3>
      <div class="box-tools">
        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
          </button>
        </div>
      </div>
    </div>
    <div class="box-body">
      <div class="row">
        <div class="col-md-3">
          <div class="form-group">
            <label>关键字</label>
            <input type="text" class="form-control" name="name" ng-model="search.name" placeholder="档案号,订单名称,信件单号">
          </div>
        </div>
        <div class="col-md-3">
          <div class="form-group">
            <label>状态</label>
            <select class="form-control select2" name="status" ng-model="search.status">
              <option value="">全部</option>
              <option value="0">未审核</option>
              <option value="1">通过</option>
              <option value="-1">驳回</option>
            </select>
          </div>
        </div>
        <div class="col-md-3">
          <div class="form-group">
            <label>寄件开始日期</label>
            <input type="text" class="form-control date-input" id="start_time" ng-model="search.start_time" placeholder="开始日期">
          </div>
        </div>
        <div class="col-md-3">
          <div class="form-group">
            <label>寄件结束日期</label>
            <input type="text" class="form-control date-input" id="end_time" ng-model="search.end_time" placeholder="结束日期">
          </div>
        </div>
      </div>
    </div>
    <div class="box-footer">
      <a class="btn btn-sm btn-info btn-flat pull-right" ng-click="query()">查询</a>
    </div>
  </div>
  <div class="box box-danger">
    <div class="box-body table-responsive no-padding">
      <table class="table table-hover">
        <tbody>
          <tr>
            <th style="width: 10px">#</th>
            <th>信件单号</th>

            <th>档案号</th>
            <th>订单名称</th>
            <th>收件人</th>
            <th>电话</th>
            <th>信件内容</th>

            <th>寄件日期</th>
            <th style="width:75px;">创建人</th>
            <th style="width:75px;">审核人</th>
            <th style="width:75px;">状态</th>
            <th class="opt-col" style="width:145px;">操作</th>
          </tr>
          <tr ng-repeat="item in data.items">
            <td ng-bind="($index+1)+'.'"></td>
            <td ng-bind="item.code"></td>

            <td ng-bind="isCreator(item) ? item.order_code : '--'"></td>
            <td ng-bind="isCreator(item) ? item.order_name : '--'"></td>
            <td ng-bind="isCreator(item) ? item.receiver : '--'"></td>
            <td ng-bind="isCreator(item) ? item.tel : '--'"></td>
            <td ng-bind="isCreator(item) ? item.letter_type : '--'"></td>

            <td ng-bind="format(item.date_at, 'YYYY-MM-DD')"></td>
            <td ng-bind="item.creator_name"></td>
            <td ng-bind="item.audit_name"></td>
            <td>
              <span id="tool-tip{{$index}}" style="cursor: default;" class="label" ng-attr-title="{{getTitle(item, $index)}}" ng-class="{'label-warning': (item.review_status==0), 'label-success': (item.review_status==1), 'label-danger': (item.review_status==-1)}" ng-bind="getStatus(item)">
              </span>
            </td>
            <td class="opt-col" style="text-align: left;">
              <a href="javascript:;" ng-click="print(item.id)"> 打印</a>
              <a href="javascript:;" ui-sref="letter_view({id: item.id})"> 详情</a>
              <a href="javascript:;" ng-if="item.deleteable" ng-click="delete(item)"> 删除</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="box-footer clearfix">
      <a ui-sref="letter_add" class="btn btn-sm btn-info btn-flat pull-left">新增</a>
      <div pagination page-data="data.page" page-click="go(idx)"></div>
    </div>
  </div>
</section>
<div ui-view="modal"></div>
